const { no, ok } = require('../../utils/utlis');

const albumService = require('../../services/client/albumService');
module.exports = {
	// 相册列表
	list: async (req, res, next) => {
		try {
			let { pageNum, pageSize } = req.body;
			let obj = await albumService.list(pageNum, pageSize);
			res.send(ok(obj));
		} catch (error) {
			res.send(no(error.message));
		}
	},
	listById: async (req, res, next) => {
		try {
			let { id } = req.body;
			let list = await albumService.listById(id);
			res.send(ok(list));
		} catch (error) {
			res.send(no(error.message));
		}
	},
	pwd: async (req, res, next) => {
		try {
			let { id, password } = req.body;
			let obj = await albumService.pwd(id, password);
			res.send(ok(obj));
		} catch (error) {
			res.send(no(error.message));
		}
	}
};
